<!-- <script src="https://cdn.bootcss.com/jquery_lazyload/1.9.7/jquery.lazyload.js"></script> -->

<img  width="640" height="480" 
src="https://i02piccdn.sogoucdn.com/b01331dc93518d5d" 
data-original="./img/奥特曼1.jpg" 
/><br>
<img  width="640" height="480" 
src="https://i02piccdn.sogoucdn.com/b01331dc93518d5d" 
data-original="./img/奥特曼2.jpg" 
/><br>
<img  width="640" height="480" 
src="https://i02piccdn.sogoucdn.com/b01331dc93518d5d" 
data-original="./img/奥特曼3.jpg" 
/><br>
<img  width="640" height="480" 
src="https://i02piccdn.sogoucdn.com/b01331dc93518d5d" 
data-original="./img/奥特曼4.jpg" 
/><br>
<img  width="640" height="480" 
src="https://i02piccdn.sogoucdn.com/b01331dc93518d5d" 
data-original="./img/奥特曼5.jpg" 
/><br>
<img  width="640" height="480" 
src="https://i02piccdn.sogoucdn.com/b01331dc93518d5d" 
data-original="./img/奥特曼6.jpg" 
/>
<script src="./jq.js"></script>
<script>
    let t
    (function(){
        $.fn.extend({
            lazyLoad(){
                if(t)return
                t = setTimeout(()=>{
                    let h1 = window.innerHeight || document.documentElement.clientHeight
                    let h2 = document .documentElement.scrollTop || document.body.scrollTop
                    let totalHeight = h1+h2      
                    
                    this.each((index,item)=>{
                        let top = $(item).offset().top
                        if(top<=totalHeight){
                            $(item).attr('src',$(item).attr('data-original'))
                        }
                    })
                    t=null
                },1000)
            }
        })
    })()
    $('img').lazyLoad()
    window.onscroll = function(){
    $('img').lazyLoad()
    }
    </script>















